<template>
    <div class="goods-item-box">
        <div class="img-box">
            <img :src="itemData.goodsImg" alt=""></img>
        </div>
        <div class="text-box">
            <div class="tiltle-box">{{ itemData.title }}</div>
            <div class="cost-box">
                <div class="now-cost-num" v-html="itemData.oldPreice">
                </div>
                <div class="before-cost-num" v-html="itemData.newPreice">
                    
                </div>
                <div class="plus-car">
                    <span>+</span>
                </div>
            </div>
            <div class="label-box">
                <span v-for="(item, i) in itemData.labelArr" :key="i">{{  item.text }}</span>
                <!-- 。。。。 -->
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        props: ['itemData']
    }
</script>

<style lang="scss" scoped>
.goods-item-box{
    width: 260px;
    height: 360px;
    border: 2px solid #cccccc00;
    border-radius: 16px;
    overflow: hidden;
    --img-height: 260px;
    cursor: pointer;
    margin: 10px;
    &:hover{
        border: 2px solid #f71111;
    }
    .img-box{
        height: var( --img-height);
        width: 100%;
        display: flex;
        overflow: hidden;
        align-items: center;
        img{
            width: 100%;
        }
    }
    .text-box{
        height: calc(100% - var( --img-height));
        width: 100%;
        overflow: hidden;
        .tiltle-box{
            line-clamp: 2;
            height: 50px;
            line-height: 25px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            word-wrap: break-word;
            overflow: hidden;
            text-overflow: ellipsis;
        }
    }
    .cost-box{
        display: flex;
        position: relative;
        .now-cost-num{
            color: red;
        }
        .before-cost-num{
            margin-left: 10px;
            color: #cccccc;
        }
        .small{
            font-size: 12px;
            i{
                font-style: normal;
                font-size: 16px;
                position: relative;
                left: -2px;
            }
        }
        .plus-car{
            position: absolute;
            right: 10px;
            span{
                display: block;
                width: 20px;
                height: 20px;
                border-radius: 50%;
                background-color: rgb(243, 208, 208);
                line-height: 16px;
                text-align: center;
                color: red;
                font-size: 20px;
                font-weight: 600;
            }
        }
    }
    .label-box{
        display: flex;
        font-size: 12px;
        span{
            color: #fa6335;
            background-color: #f8c2b1;
            margin-left: 5px;
            padding: 2px 3px;
        }
    }
}
</style>